﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
//Frameless Main Window
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(int width, int height, QWidget *parent = 0);
public slots:
    void button_max_clicked();
protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void mouseDoubleClickEvent(QMouseEvent *e);
    void changeEvent(QEvent *event);
    virtual void setMaximizeButton(bool isMax) = 0;
    virtual bool isTitle(const QPoint& pos) const = 0;
    virtual void handleWindowMinimized();
    void setSize(const QSize& size);
    QSize defaultSize;
private:
    QPoint dragPosition;
    bool moveWidget;
};

#endif // MAINWINDOW_H
